from django.db import models
from django.utils import timezone
import uuid

class ImageModel(models.Model):
    objects = models.Manager()
    name = models.CharField(max_length=100)
    image_path = models.CharField(max_length=255)  # 存储图片的路径

    # 定义分类选项
    CATEGORY_CHOICES = [
        (1, '我们是谁'),
        (2, '成立背景'),
        (4, '团队风采'),
        (6, '联系我们'),
    ]
    category = models.IntegerField(choices=CATEGORY_CHOICES, default=1,help_text="板块类型：（1）我们是谁，（2）成立背景，（4）团队风采，（6）联系我们")  # 新增分类字段

    class Meta:
        db_table = 'about_image_path'


class VisitorInfo(models.Model):

    objects = models.Manager()
    id = models.CharField(primary_key=True, default=uuid.uuid4, editable=False, max_length=255)
    # 需求类型 1：合作咨询，2：空间入驻，3：政策申报
    REQUIREMENT_TYPE_CHOICES = [
        (1, '合作咨询'),
        (2, '空间入驻'),
        (3, '政策申报'),
    ]
    requirement_type = models.IntegerField(choices=REQUIREMENT_TYPE_CHOICES, default=1, help_text="需求类型：（1）合作咨询，（2）空间入驻，（3）政策申报")
    name = models.CharField(max_length=100, help_text="姓名")
    phone = models.CharField(max_length=100, help_text="手机")
    email = models.EmailField(max_length=100, help_text="邮箱")
    company = models.CharField(max_length=100, help_text="单位")
    city = models.CharField(max_length=100, help_text="所在城市")
    requirement_description = models.CharField(max_length=500, help_text="需求描述，500字以内")
    # 创建时间
    created_at = models.DateTimeField(default=timezone.now, help_text='创建时间')

    class Meta:
        db_table = 'about_visitor_info'